﻿Imports System.Windows.Forms

Public Class UCConsolidado

    Private Sub txtDocumento2_LostFocus(sender As Object, e As System.EventArgs) Handles txtDocumento2.LostFocus
        Dim sdoc As String = txtDocumento2.EditValue.ToString.Replace("-", "")
        Dim sser As String = Strings.Left(sdoc, 4)
        Dim snro As String = Strings.Right("00000000" & Strings.Mid(sdoc, 5).Trim, 8)
        txtDocumento2.EditValue = String.Format("{0}-{1}", sser, snro)
    End Sub

    Private Sub GridView2_InvalidValueException(sender As Object, e As DevExpress.XtraEditors.Controls.InvalidValueExceptionEventArgs) Handles GridView2.InvalidValueException
        'Do not perform any default action 
        e.ExceptionMode = DevExpress.XtraEditors.Controls.ExceptionMode.NoAction
        'Show the message with the error text specified 
        MessageBox.Show(e.ErrorText)
    End Sub

    Private Sub txtNroTicket_LostFocus(sender As Object, e As System.EventArgs) Handles txtNroTicket.LostFocus
        Dim stic As String = txtNroTicket.EditValue.ToString
        txtNroTicket.EditValue = Strings.Right("00000000" & stic.Trim, 8)
    End Sub

    Private Sub txtTicket_LostFocus(sender As Object, e As System.EventArgs) Handles txtTicket.LostFocus
        Dim stic As String = txtTicket.EditValue.ToString
        txtTicket.EditValue = Strings.Right("00000000" & stic.Trim, 8)
    End Sub
End Class